/* 
 * Copyright [2018] [Alex/libo(liboms@hotmail.com)]
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.hyts.aop.test;

import com.hyts.aop.AopProxy;
import com.hyts.aop.annotation.Aop;
import com.hyts.aop.annotation.Inject;
import com.hyts.aop.proxy.AopContext;
import com.hyts.aop.test.cglib.AopSuperClass;
import com.hyts.aop.test.jdk.AopInterface;

/**
 * @title TestInjectService.java
 * @package com.hyts.aop.test
 * @author libo/Alex
 * @email liboms@hotmail.com/liboware@163.com
 * @date 2018年4月26日
 * @version V1.0
 */
@Aop
public class CallDI {

    @Inject
    private AopInterface aop;
    
    @Inject
    private AopSuperClass aop2;

    public void jdk() {
        aop.execute("1231");
        //aop.execute1();
    }

    public void cglib() {
        aop2.test("好");
    }

    /**
     * @exception
     */
    public static void testAop() {
        AopProxy aopProxy = new AopProxy();
        AopContext aopContext = aopProxy.initAopContext("com.hyts");
        CallDI defined = aopProxy.getCallerProxy(CallDI.class);
        defined.jdk();
        defined.cglib();
    }


    public static void main(String[] args) {
        testAop();
    }
}
